/*
 * @Author: CPS
 * @Date: 2020-07-25 18:01:11
 * @Last Modified by:   Administrator
 * @Last Modified time: 2020-08-04 09:24:55
 * @Projectname Electron-fileWatcher
 * @Filename index.js
 */
'use strict'
import subWindow from './notificationToWindow.js';
import {
  ipcRenderer,
  remote
} from 'electron'



// 子窗口创建完成后
window.addEventListener('DOMContentLoaded', (e => {
  //创建弹窗实例
  let tar = ''
  let win = subWindow()

  if (win) {
    ipcRenderer.send('subWindow-ready')
  }

  //给主程序发送初始化事件

  //创建监听事件
  ipcRenderer.on('push-msg', (e, msg) => {
    console.log('push-msg接受到消息: ' + msg)
    win.pushMsg(msg)
  })
}));